﻿
using Irony.Compiler;

namespace IronLua.Ast {

	public class DoStatement : Statement {

		readonly BlockStatement body;

		public BlockStatement Body {
			get { return body; }
		}

		public override LuaNodeType NodeType {
			get { return LuaNodeType.DoStatement; }
		}

		public DoStatement (CompilerContext context, NonTerminal nonTerminal, SourceLocation location, AstNodeList childNodes)
			: base (context, nonTerminal, location, childNodes)
		{
			body = childNodes [1].To<BlockStatement> ();
		}

		public override void Accept (ILuaAstVisitor visitor)
		{
			visitor.VisitDoStatement (this);
		}
	}
}
